package com.fz.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fz.entity.Store;
import com.fz.service.StoreService;
import com.fz.vo.ResultVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 存储门店基础信息 前端控制器
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@RestController
@RequestMapping("/stores")
public class StoreController {
    @Resource
    StoreService storesService;
    @GetMapping("/list")
    ResultVo<IPage<Store>> list(Integer PageNo, Integer PageSize)throws InterruptedException {
        return ResultVo.success(storesService.page(new Page<>(PageNo,PageSize)));
    }
    @PostMapping("/del")
    ResultVo<Boolean> deleteTRole(Long id,Boolean status) {
        return ResultVo.success(storesService.del(id,status),status ? "启用门店成功" : "禁用门店成功");
    }
}
